]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
gdm: generalize fingerprint message into login hint
authorRay Strode <rstrode@redhat.com>
Mon, 20 Aug 2012 00:15:18 +0000 (20:15 -0400)
committerRay Strode <rstrode@redhat.com>
Tue, 21 Aug 2012 17:15:28 +0000 (13:15 -0400)
The fingerprint message is useful for users that click their
names in the user list to let them know if fingerprint login
is available.

This same place on screen (below the login entry) can potentially
be used for other messages as well.

This commit changes the variable and style names surrounding
this feature to be more generic.

A subsequent commit will leverage this functionality to provide
a hint on how to log in to the local enterprise domain controller
(if relevant).

https://bugzilla.gnome.org/show_bug.cgi?id=681975

data/theme/gnome-shell.css
js/gdm/loginDialog.js
js/gdm/util.js
js/ui/unlockDialog.js

index 07aee818e24cc668829c97edf1442f0d320b2da4..ee6f01a3eca4cd0be699b5612e4960dc422771be 100644 (file)
@@ -1988,7 +1988,7 @@ StButton.popup-menu-item:insensitive {
     min-width: 350px;
 }
 
-.login-dialog-prompt-fingerprint-message {
+.login-dialog-prompt-login-hint-message {
     font-size: 10.5pt;
 }
 
index 5c60d24b25af7ed66e47ecd772f3230739eb5113..9e103ec1cdfc1b94ff8d55ccd89d7fd895a7a6b2 100644 (file)
@@ -696,8 +696,8 @@ const LoginDialog = new Lang.Class({
         this._userVerifier.connect('verification-failed', Lang.bind(this, this._onVerificationFailed));
         this._userVerifier.connect('reset', Lang.bind(this, this._onReset));
 
-        this._userVerifier.connect('show-fingerprint-prompt', Lang.bind(this, this._showFingerprintPrompt));
-        this._userVerifier.connect('hide-fingerprint-prompt', Lang.bind(this, this._hideFingerprintPrompt));
+        this._userVerifier.connect('show-login-hint', Lang.bind(this, this._showLoginHint));
+        this._userVerifier.connect('hide-login-hint', Lang.bind(this, this._hideLoginHint));
 
         this._settings = new Gio.Settings({ schema: GdmUtil.LOGIN_SCREEN_SCHEMA });
 
@@ -761,12 +761,9 @@ const LoginDialog = new Lang.Class({
                               x_fill: true,
                               y_fill: false,
                               x_align: St.Align.START });
-        // Translators: this message is shown below the password entry field
-        // to indicate the user can swipe their finger instead
-        this._promptFingerprintMessage = new St.Label({ text: _("(or swipe finger)"),
-                                                        style_class: 'login-dialog-prompt-fingerprint-message' });
-        this._promptFingerprintMessage.hide();
-        this._promptBox.add(this._promptFingerprintMessage);
+        this._promptLoginHint = new St.Label({ style_class: 'login-dialog-prompt-login-hint-message' });
+        this._promptLoginHint.hide();
+        this._promptBox.add(this._promptLoginHint);
 
         this._sessionList = new SessionList();
         this._sessionList.connect('session-activated',
@@ -854,7 +851,7 @@ const LoginDialog = new Lang.Class({
 
                      function() {
                          this._sessionList.close();
-                         this._promptFingerprintMessage.hide();
+                         this._promptLoginHint.hide();
                          this._userList.actor.show();
                          this._userList.actor.opacity = 255;
                          return this._userList.showItems();
@@ -875,12 +872,14 @@ const LoginDialog = new Lang.Class({
         this._sessionList.setActiveSession(sessionId);
     },
 
-    _showFingerprintPrompt: function() {
-        GdmUtil.fadeInActor(this._promptFingerprintMessage);
+    _showLoginHint: function(verifier, message) {
+        this._promptLoginHint.set_text(message)
+        GdmUtil.fadeInActor(this._promptLoginHint);
     },
 
-    _hideFingerprintPrompt: function() {
-        GdmUtil.fadeOutActor(this._promptFingerprintMessage);
+    _hideLoginHint: function() {
+        GdmUtil.fadeOutActor(this._promptLoginHint);
+        this._promptLoginHint.set_text('');
     },
 
     cancel: function() {
@@ -899,8 +898,8 @@ const LoginDialog = new Lang.Class({
                      function() {
                          // Show it with 0 opacity so we preallocate space for it
                          // in the event we need to fade in the message
-                         this._promptFingerprintMessage.opacity = 0;
-                         this._promptFingerprintMessage.show();
+                         this._promptLoginHint.opacity = 0;
+                         this._promptLoginHint.show();
                      },
 
                      function() {
@@ -972,7 +971,7 @@ const LoginDialog = new Lang.Class({
                      },
 
                      function() {
-                         this._promptFingerprintMessage.hide();
+                         this._promptLoginHint.hide();
                          this._promptEntry.reactive = true;
                          this._promptEntry.set_text('');
                      }];
index fb68ab09946a7c6095bde572c73d88e1e207c672..3224539c77beaa1e5d772e0ff16db7e663894ca3 100644 (file)
@@ -211,7 +211,10 @@ const ShellUserVerifier = new Lang.Class({
         // as a cue to display our own message.
         if (serviceName == FINGERPRINT_SERVICE_NAME &&
             this._haveFingerprintReader) {
-            this.emit('show-fingerprint-prompt');
+
+            // Translators: this message is shown below the password entry field
+            // to indicate the user can swipe their finger instead
+            this.emit('show-login-hint', _("(or swipe finger)"));
         } else if (serviceName == PASSWORD_SERVICE_NAME) {
             Main.notifyError(info);
         }
@@ -261,7 +264,7 @@ const ShellUserVerifier = new Lang.Class({
         if (serviceName == PASSWORD_SERVICE_NAME) {
             this.emit('verification-failed');
         } else if (serviceName == FINGERPRINT_SERVICE_NAME) {
-            this.emit('hide-fingerprint-prompt');
+            this.emit('hide-login-hint');
         }
     },
 });
index 86ce8ec5213884dee9fca4722a8f3378a1d8d63f..fb510fcbc3fc6528321725842da47eb419004434 100644 (file)
@@ -97,8 +97,8 @@ const UnlockDialog = new Lang.Class({
         this._userVerifier.connect('verification-complete', Lang.bind(this, this._onVerificationComplete));
         this._userVerifier.connect('verification-failed', Lang.bind(this, this._onVerificationFailed));
 
-        this._userVerifier.connect('show-fingerprint-prompt', Lang.bind(this, this._showFingerprintPrompt));
-        this._userVerifier.connect('hide-fingerprint-prompt', Lang.bind(this, this._hideFingerprintPrompt));
+        this._userVerifier.connect('show-login-hint', Lang.bind(this, this._showLoginHint));
+        this._userVerifier.connect('hide-login-hint', Lang.bind(this, this._hideLoginHint));
 
         this._userWidget = new UserWidget(this._user);
         this.contentLayout.add_actor(this._userWidget.actor);
@@ -122,12 +122,9 @@ const UnlockDialog = new Lang.Class({
 
         this.contentLayout.add_actor(this._promptLayout);
 
-        // Translators: this message is shown below the password entry field
-        // to indicate the user can swipe their finger instead
-        this._promptFingerprintMessage = new St.Label({ text: _("(or swipe finger)"),
-                                                        style_class: 'login-dialog-prompt-fingerprint-message' });
-        this._promptFingerprintMessage.hide();
-        this.contentLayout.add_actor(this._promptFingerprintMessage);
+        this._promptLoginHint = new St.Label({ style_class: 'login-dialog-prompt-login-hint' });
+        this._promptLoginHint.hide();
+        this.contentLayout.add_actor(this._promptLoginHint);
 
         let cancelButton = { label: _("Cancel"),
                              action: Lang.bind(this, this._escape),
@@ -183,12 +180,13 @@ const UnlockDialog = new Lang.Class({
         this._updateOkButton(true);
     },
 
-    _showFingerprintPrompt: function() {
-        GdmUtil.fadeInActor(this._promptFingerprintMessage);
+    _showLoginHint: function(verifier, message) {
+        this._promptLoginHint.set_text(message)
+        GdmUtil.fadeInActor(this._promptLoginHint);
     },
 
-    _hideFingerprintPrompt: function() {
-        GdmUtil.fadeOutActor(this._promptFingerprintMessage);
+    _hideLoginHint: function() {
+        GdmUtil.fadeOutActor(this._promptLoginHint);
     },
 
     _doUnlock: function() {